package cn.edu.stu.syllabus.repository.token;

import javax.inject.Inject;

import cn.edu.stu.syllabus.di.qualifier.Remote;
import cn.edu.stu.syllabus.di.scope.FragmentScoped;
import cn.edu.stu.syllabus.repository.token.local.TokenEntry;
import rx.Observable;

/**
 * Created by daidaijie on 2017/4/25.
 */

@FragmentScoped
public class TokenRepository implements TokenDataSource {

    TokenDataSource mTokenRemoteDataSource;

    @Inject
    public TokenRepository(@Remote TokenDataSource tokenRemoteDataSource) {
        mTokenRemoteDataSource = tokenRemoteDataSource;
    }

    @Override
    public Observable<TokenEntry> getToken(String code) {
        return mTokenRemoteDataSource.getToken(code);
    }
}
